#pragma once

#include <string>
#include <set>
#include <functional>
#include "Singleton.h"
#include "MsgRouter.h"
#include "1700_account.pb.h"


class AccountService
{
public:
    bool Init();

public:
    AccountService() = default;
    virtual ~AccountService() = default;

public:
    static AccountService* Instance()
	{
		return CSingleton<AccountService>::Instance();
	}

public:
    enum Sence
    {
        ACCESS_LOGIN = 100,
    };

public:
    bool HandleGetToken(const std::string& agency, const std::uint32_t agency_id, const std::string& username, const std::string& token, 
        const std::string& currency, const std::string& hall_url, const std::string& platform, const std::int64_t balance,
         const std::uint32_t game, const std::string& gameinfo, std::string&& trans, Sence sence);
    void OnGetToken(MsgData&& data);
    inline void ListenOnGetToken(Sence sence, std::function<void(account_proto::GenLoginTokenResp&& get_token_resp)> listen)
    {
        m_get_token_listen[sence] = listen;
    }
private:
    std::map<Sence, std::function<void(account_proto::GenLoginTokenResp&& )>> m_get_token_listen;

};















